#!/usr/bin/env python
# -*- coding:utf-8 -*-
# File:text2image.py
# Author:yuanronghao
# Time:2023/3/23 15:23
# Software:PyCharm


import openai
from configparser import ConfigParser

CONFIG = ConfigParser()
CONFIG.read('system.conf', encoding='utf-8')
openai.organization = CONFIG['ORG_ID']['ORG_ID']
openai.api_key = CONFIG['API_KEYS']['OPENAI_API_KEY']

completion = openai.Image.create(
    prompt=" A banana shaped airplane",
    n=2,
    size="1024x1024"
)
print(completion)
